﻿using ConfExpert.Forms.Base;
using DevTeam;
using System;

namespace ConfExpert.Forms.Depo
{
    public partial class UKEdit : XForm
    {
        public UKEdit()
        {
            InitializeComponent();
        }

        private void UKEdit_Load(object sender, EventArgs e)
        {
            gridView1.Init("GetUKEdit");
            gridView1.AddDetailGrid(gridView2, "VendorId");
            gridView2.MakeColumnInvisible("Name", "UreticiKodlariId");
            gridView2.AddColumn("Aynı", typeof(string), "IIF(Name=UreticiKodu,'E',null)");
            gridView2.YanYanaGetirSoluna("UreticiKodu", "Aynı");
            gridView1.MakeReadOnly();
            gridView2.MakeReadOnly("UreticiKodu", "KaliteId", "KaliteAciklama", "KVendorId", "KCustomerId");
            gridView1.AddSummary("Adet");
            gridView2.AddSummary();

            btnKaydet.Enabled = false;
            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
            gridView1.FocusedRowChanged += gridView1_FocusedRowChanged;
        }

        void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            gridView2.BestFitColumns();
        }
    }
}
